<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/inc/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>注册会员</title>
		<link type="text/css" rel="stylesheet" href="${path }/js/easyui/themes/default/easyui.css">
		<link type="text/css" rel="stylesheet" href="${path }/js/easyui/themes/icon.css">
		<script type="text/javascript" src="${path }/js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="${path }/js/easyui/jquery.easyui.min.js"></script>
		<script type="text/javascript">
			var path="${path}";
		</script>
		<script type="text/javascript" src="${path }/js/form/jquery.form.js"></script>
		<script type="text/javascript" charset="utf-8" src="${path }/js/editor/kindeditor.js"></script>
		<script type="text/javascript" src="${path}/js/date/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="${path }/js/zDialog.js"></script>
		<script type="text/javascript" src="${path }/js/zDrag.js"></script>
		<script type="text/javascript">
		
			$(document).ready(function() { 
					var options = {
						beforeSubmit: checkForm,
						dataType : 'json',
						success:addAppBack
					};
					
				 	$('#addForm').ajaxForm(options); 
				    
			}); 
			
			
			
			function checkForm(){
				//return false;
			}
			function addAppBack(json){
				//var obj = eval('(' + json + ')');
				
				if(json.result=="Success"){
					alert("注册成功!");
					refleshOpener();
				}else if(json.result == "Faile" && json.ErrorCode == "-1"){
					alert("用户名已存在,请换个别的用户名");
				}
			}
		
			function refleshOpener(){
				ownerDialog.opener.location = "/index";
				ownerDialog.close();
			}
		</script>
	</head>
	<body>
		<form action="${path}/member/save" method="post" id="addForm" name="addForm" ENCTYPE="multipart/form-data">
			<div title="填写信息" class="easyui-panel" style="width:500px;height:280px;padding:10px;background:#fafafa;">
				<table >
					<tr>
						<td>
							用户名(英文+数字):
						</td>
						<td>
							<input type="text"  id="memberName" name="memberName" size="40"><font color="red">*</font>
						</td>
					</tr>
					<tr>
						<td>
							用户密码:
						</td>
						<td>
							
							<input type="password" id="memberPwd" name="memberPwd" size="40" >
							
						</td>
					</tr>
					<tr>
						<td>
							真实姓名:
						</td>
						<td>
							<input type="text" id="memberRealName" name="memberRealName" size="40" >
						</td>
					</tr>
					
					<tr>
						<td>
							性别:
						</td>
						<td>
							<input type="radio" name="memberSex" value="1" checked />男
							<input type="radio" name="memberSex" value="0" />女
						</td>
					</tr>
					
					<tr>
						<td>
							邮箱:
						</td>
						<td>
							<input type="text" id="memberEmail" name="memberEmail" size="40" >
						</td>
					</tr>
					<tr>
						<td>
							地址:
						</td>
						<td>
							<input type="text" id="memberAddr" name="memberAddr" size="40">
						</td>
					</tr>
				</table>
			</div>
			
			<div title="您的头像" class="easyui-panel" style="width:500px;height:180px;padding:10px;background:#fafafa;">
				<div style="width:400;float:left">
					<table>
						
						<tr>
							<td>
								请选择头像图片:
							</td>
							<td>
								<input type="file" id="photoFile" name="photoFile" size="20" />
								<div id="fileDiv" style="width:300px;">
									
								</div>
							</td>
						</tr>
					</table>
				</div>
			</div>
			
			<div>
				<table>
					<tr>
						<td>
							<input type="submit" value="注册">
						</td>
					</tr>
				</table>
			</div>
			
		</form>
	</body>
</html>